﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using CXMLStudioIDE;
using CXMLStudioIDE.Common;

namespace CXMLStudioIDE.Common.Entities
{
    public class ScopeCollection : CollectionBase
    {
        #region Methods

        public Scope this[int index]
        {
            get
            {
                return ((Scope)List[index]);
            }
            set
            {
                List[index] = value;
            }
        }

        public int Add(Scope value)
        {
            return (List.Add(value));
        }

        public int IndexOf(Scope value)
        {
            return (List.IndexOf(value));
        }

        public void Insert(int index, Scope value)
        {
            List.Insert(index, value);
        }

        public void Remove(Scope value)
        {
            List.Remove(value);
        }

        public bool Contains(Scope value)
        {
            // If value is not of type Int16, this will return false.
            return (List.Contains(value));
        }

        public int IndexOf(int ScopeID)
        {
            int result = -1;
            for (int i = 0; i < List.Count; i++)
            {
                Scope s = List[i] as Scope;
                if (s.ID == ScopeID)
                    result = i;
            }
            return result;
        }

        #endregion
    }
}
